Skip to content

Method: calculateMove(IKopplung, State, Integer, IGstKopplungsMiniMaxStrategy)

1: package de.fhdw.gaming.ipspiel23.gst.domain.impl;
2:
3: import de.fhdw.gaming.core.domain.Move;
4: import de.fhdw.gaming.core.domain.Player;
5: import de.fhdw.gaming.core.domain.State;
6: import de.fhdw.gaming.ipspiel23.gst.domain.ICalculatorKopplung;
7: import de.fhdw.gaming.ipspiel23.gst.domain.IKopplung;
8: import de.fhdw.gaming.ipspiel23.gst.strategies.domain.IGstKopplungsMiniMaxStrategy;
9:
10: /**
11: * The implementation of the ICalculatorKopplung interface for calculating the next move for the current player in a
12: * game.
13: *
14: * @param <P> The type of player in the game.
15: * @param <S> The type of state in the game.
16: * @author borkowitz
17: */
18: public class GstKopplungsMoveCalculator<P extends Player<P>, S extends State<P, S>>
19: implements ICalculatorKopplung<P, S> {
20:
21: /**
22: * Calculates the next best move for the current Player in the game based on the given parameters.
23: *
24: * @param kopplung The game object representing the specific game being played.
25: * @param state The current state of the game.
26: * @param maximumComputationTime The maximum computation time allowed for calculating the move (in seconds).
27: * @param strategy The mini-max strategy used for calculating the move.
28: * @return The calculated move for the player in the given state.
29: */
30: @Override
31: public Move<P, S> calculateMove(final IKopplung<P, S> kopplung, final S state,
32: final Integer maximumComputationTime,
33: final IGstKopplungsMiniMaxStrategy<P, S> strategy) {
34: return strategy.calculateBestMove(kopplung, state, maximumComputationTime).get();
35: }
36: }